package com.itasura.builder;

/**
 * @author sailor wang
 * @date 2018/9/12 上午10:21
 * @description
 */
public class Tea {
    private Milk milk;

    private Size size;

    private Sugar sugar;

    private Temperature temperature;

    @Override
    public String toString() {
        return this.size.getDesc()+" "+this.milk.getDesc()+" "+this.sugar.getDesc()+" "+this.temperature.getDesc();
    }

    private Tea(Builder builder) {
        this.milk = builder.milk;
        this.size = builder.size;
        this.sugar = builder.sugar;
        this.temperature = builder.temperature;
    }

    public static Builder builder(){
        return new Builder();
    }

    public static class Builder {
        private Milk milk;

        private Size size;

        private Sugar sugar;

        private Temperature temperature;

        public Builder milk(Milk milk) {
            this.milk = milk;
            return this;
        }

        public Builder size(Size size) {
            this.size = size;
            return this;
        }

        public Builder sugar(Sugar sugar) {
            this.sugar = sugar;
            return this;
        }

        public Builder temperature(Temperature temperature) {
            this.temperature = temperature;
            return this;
        }

        public Tea build(){
            return new Tea(this);
        }
    }

    public Milk getMilk() {
        return milk;
    }

    public void setMilk(Milk milk) {
        this.milk = milk;
    }

    public Size getSize() {
        return size;
    }

    public void setSize(Size size) {
        this.size = size;
    }

    public Sugar getSugar() {
        return sugar;
    }

    public void setSugar(Sugar sugar) {
        this.sugar = sugar;
    }

    public Temperature getTemperature() {
        return temperature;
    }

    public void setTemperature(Temperature temperature) {
        this.temperature = temperature;
    }
}